﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace GameName1
{
    class AngryAlien : Alien, IAngryAlienObservable
    {
        public IWeapon Weapon { get; set; }
        private List<IAngryAlienObserver> observers = new List<IAngryAlienObserver>();

        public AngryAlien(Vector2 position) : base(position)
        {
        }
        protected AngryAlien() 
        {
           
        }

        public override Vector2 Velocity { get; set; }
        public override Vector2 Position { get; set; }

        public override void HandleHit()
        {
            Notify(this);
        }

        public override void Move()
        {
            throw new NotImplementedException();
        }

        public void Notify(AngryAlien angryAlien)
        {
            foreach (var angryAlienObserver in observers)
            {
                angryAlienObserver.Update(angryAlien);
            }
        }
        public void RegisterObserver(IAngryAlienObserver observer)
        {
            observers.Add(observer);
        }
        public void RemoveObserver(IAngryAlienObserver observer)
        {
            observers.Remove(observer);
        }
    }
}
